# -*- coding: utf-8 -*-
#   全局字典
# @Time    ： 2025/8/11  16:33
# @Auther  ： 徐良
# File     :  globalDictionary.py
from share.dataFactory import DataFactory
from typing import Dict, Tuple
import share.globalvar as gol

def get_control_switch() -> Dict[str, Tuple[str, int]]:
    sql = 'select * from t_mesControlSwitch where FDetail=1 order by FNumber'
    model = DataFactory.get_query_model_by_sql(sql)
    control_switch_dict = {}
    for row in range(0, model.rowCount()):
        number = model.record(row).value('FNumber')
        description = model.record(row).value('FDescription')
        switch = model.record(row).value('FSwitch')

        control_switch_dict[number] = (description, switch,)

    return control_switch_dict

def get_bill_status() -> Dict[str, int]:
    """
    返回单据状态的真假值
    :return:
    """
    bill_status_dict = {
        '未执行': 0,
        '已执行': 1,

        '未审核': 0,
        '已审核': 1,

        '未汇报': 0,
        '已汇报': 1,
    }
    return bill_status_dict




